import { createApp } from 'vue'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

import App from './App.vue'
import router from './router'

// Element Plus 及其样式
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

// Vant 及其样式
import 'vant/lib/index.css'
import Vant from 'vant'
import { ImagePreview } from 'vant'; // 或者使用组件式调用

const app = createApp(App)

// Pinia 状态管理及其持久化插件
const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)
app.use(pinia)

// 使用路由、Element Plus 和 Vant
app.use(router).use(ElementPlus).use(Vant)
app.use(ImagePreview)

app.mount('#app')
